import { createRouter, createWebHashHistory } from "vue-router";

const router = createRouter({
  history: createWebHashHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: "/",
      name: "layout",
      redirect: "/machine",
      component: () => import("@/layout/index.vue"),
      children: [
        {
          path: "/machine",
          name: "machine",
          component: () => import("@/views/machine/Machine.vue")
        },
        {
          path: "/machine-group",
          name: "machine-group",
          component: () => import("@/views/machine-group/MachineGroup.vue")
        },
        {
          path: "/machine-tunnel",
          name: "machine-tunnel",
          component: () => import("@/views/machine-tunnel/MachineTunnel.vue")
        },
        {
          path: "/script-template",
          name: "script-template",
          component: () => import("@/views/script-template/ScriptTemplate.vue")
        },
        {
          path: "/proxy-transform",
          name: "proxy-transform",
          component: () => import("@/views/proxy-transform/ProxyTransform.vue")
        },
        {
          path: "/topology",
          name: "topology",
          component: () => import("@/views/topology/Topology.vue")
        },
        {
          path: "/topology-preview",
          name: "topologyPreview",
          component: () => import("@/views/topology/TopologyGraph.vue")
        }
      ]
    },
    {
      path: "/web-terminal",
      name: "terminal",
      component: () => import("@/views/WebTerminal.vue")
    },
    {
      path: "/topology-editor",
      name: "topologyEditor",
      component: () => import("@/views/topology/TopologyGraphEditor.vue")
    }
  ]
});

export default router;
